export const reducer = (state, action) => {
  switch (action.type) {
    case "SET_FORM":
      return { ...state, form: { ...state.form, ...action.payload } };
    case "TOGGLE_MODAL":
      return {
        ...state,
        modalOpen: action.payload
      };
    default:
      throw new Error("Unexpected action");
  }
};
